Web-based applications may include a framework for listing the navigation history performed within the web-based application. In other words, the web application can expose its own browser-like navigation history on the web pages. The browser-like navigation history of the web-based application is herein referred to as the web application history. Such a framework provides a bookmark management system on the server side. Each bookmark is a snap shot of the server-state after a user request is handled. The snapshot is uniquely identified by a server-state id. The server can retrieve a given bookmark by using the server-state id and thus restore the server-state as indicated by the bookmark. The server-state id parameter is maintained both on the client side and on the server side.
On the client side, the server-state id parameter is updated by a value sent from the server each time a user request is processed. The client side framework for maintaining navigation history is adapted to ensuring that any user request that is sent from the client and which is sensitive to the server-state has a server-state id attached to the request. When a user wishes to navigate to a previous page by clicking on the “Back” button, the request for the previous page indicates an old, i.e., non-current, server-state id. Thus, the server can detect if the request is submitted out of context by comparing the current server-state id with the one that is attached to the user request. If the server-state id attached to the request is out of sync with the current the server-state id then the server will use the server-state id attached to the request to locate the bookmark associated with the requested page in order to restore the server context before handling the request.
However, the above bookmark management system in web applications has some drawbacks. First, the book management system as described above is independent of the web browser history. Thus, in the case when a user navigates to content that is external to the web application or submits an HTML form, the web browser history will be inconsistent with the web application history. Such inconsistencies are confusing to the user.
Another problem is in respect to HTML page caching. Web page caching is desirable in most cases because it improves performance by reducing the number of roundtrips to the server for fetching content. However, the web browser may attempt to reuse cached pages even in instances when such reuse is inappropriate. For example, the web browser may reuse an invalid page that was cached at a different session of the same user or of a different user.
Yet another problem is related to the refresh feature of web browsers. In the case when web page is a page used by the user to add items to a shopping cart, each time the user refreshes the page, an item is added to the shopping cart, even though the user did not intend to add to his shopping cart.
Another problem is related to unrecoverable cached web pages. For web applications that maintain state on a server, when the context of a requested page cannot be restored, such a page is an unrecoverable page.
In view of the foregoing, an automated and efficient approach for integrating navigations both external to and internal to web-based applications is needed.